//
//  BMSNetworkSessionManager.h
//  BMSSDK
//
//  Created by YeJary on 2025/4/27.
//


#import <Foundation/Foundation.h>
#import <AFNetworking/AFNetworking.h>
#import "BMSNetworkEnvironment.h"

NS_ASSUME_NONNULL_BEGIN

typedef void(^BMSNetworkSuccessBlock)(id _Nullable responseObject);
typedef void(^BMSNetworkFailureBlock)(NSError *error);

@interface BMSNetworkSessionManager : NSObject


@property (nonatomic, strong, readonly) BMSNetworkEnvironment *environment;

- (void)switchEnvironment:(BMSNetworkEnvironmentType)type;

+ (instancetype)sharedManager;

- (void)requestWithMethod:(NSString *)method
                      URL:(NSString *)url
               parameters:(nullable NSDictionary *)parameters
                  success:(BMSNetworkSuccessBlock)success
                  failure:(BMSNetworkFailureBlock)failure;

- (void)getWithURL:(NSString *)url
        parameters:(nullable NSDictionary *)parameters
           success:(BMSNetworkSuccessBlock)success
           failure:(BMSNetworkFailureBlock)failure;

- (void)postWithURL:(NSString *)url
         parameters:(nullable NSDictionary *)parameters
            success:(BMSNetworkSuccessBlock)success
            failure:(BMSNetworkFailureBlock)failure;

@end

NS_ASSUME_NONNULL_END
